package com.reny.szkj.ft_home.ui.index.home

import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import org.kodein.di.*
import org.kodein.di.android.x.AndroidLifecycleScope

const val HOME_MODULE_TAG = "HOME_MODULE_TAG"

val homeDIModule = DI.Module(HOME_MODULE_TAG) {

    bind<HomeViewModel>() with scoped<Fragment>(AndroidLifecycleScope).singleton {
        ViewModelProvider(this.context, LoginViewModelFactory(instance())).get(HomeViewModel::class.java)
    }

    bind<HomeRepository>() with scoped<Fragment>(AndroidLifecycleScope).singleton {
        HomeRepository(instance())
    }

}